﻿Public Class Home
    Inherits System.Web.UI.Page
    Dim usr As MembershipUser = Membership.GetUser()
    Dim userId As Integer = CInt(usr.ProviderUserKey)

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If User.IsInRole("Student") Then
            btn_bookappointment.Visible = True
        End If

    End Sub

    Protected Sub btn_appointments_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btn_appointments.Click
        Response.Redirect("AppointmentsList.aspx?UserId=" & userId.ToString())
    End Sub

    Protected Sub btn_Calendar_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btn_Calendar.Click
        Response.Redirect("Calendar.aspx?Date=" & Date.Today & "&UserId=" & userId.ToString())
    End Sub

    Protected Sub btn_bookappointment_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btn_bookappointment.Click
        Response.Redirect("BookAppointment.aspx")
    End Sub

    Protected Sub btn_cancelreschedule_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btn_cancelreschedule.Click
        Response.Redirect("AppointmentsList.aspx?UserId=" & userId.ToString() & "&ref=manage")
    End Sub
End Class